import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/material.dart';
import 'package:videotop/base_view.dart';
import 'package:videotop/model/splash_model.dart';
import 'package:videotop/myinfo.dart';
import 'package:provider/provider.dart';

import '../mycolor.dart';
import '../util.dart';

/// created by hx
///    2021/1/23:14:38


class Splash extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return BaseView<SpashModel>(
      onModelReady: (model){
        model.getDeviceInfo();
      },
      model: SpashModel(context,Provider.of<MyInfo>(context),Provider.of<Util>(context)),
      builder: (context,model,child){
        return Scaffold(
          body: Center(
            child: TyperAnimatedTextKit(
              text: [
                'VideoTop',
              ],
              textStyle: TextStyle(
                  fontSize: 50.0,
                  fontWeight: FontWeight.w700,
                  color: MyColor.theme
              ),
              textAlign: TextAlign.center,
              speed: Duration(milliseconds: 400),
            ),
          ),
        );
      },
    );
    // return ChangeNotifierProvider(
    //   create: (_)=> SpashModel(),
    //   child: Consumer<SpashModel>(
    //     builder: (context,model,child) {
    //       model.getDeviceInfo(Provider.of<Util>(context));
    //       return ;
    //     },
    //   ),
    // );
  }
}